﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Orchid.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult About()
        {
            Spider.Spider spider = new Spider.Spider();
            Uri uri = new Uri("http://news.qq.com/newsgn/rss_newsgn.xml");
            spider.Ingest(uri);
            ViewData["Article"] = Spider.Article.Articles[2].Content;
            foreach(Spider.Article article in Spider.Article.Articles)
            {
                ViewData["articles"] += "<h2>" + article.Title + "</h2>" + "<p>" + article.Content + "</p>";
            }
            return View();
        }
    }
}
